#{extends "main.html" /}
#{if entity}
#{set title:"TA015 DETAIL " + entity.getReformat_template_name() /}
#{/if}
#{if !entity}
#{set title:"Create TA015" /}
#{/if}
#{set entityId = entity ? entity.id : null /}

#{form @controllers.ReformatTemplate.save(entityId) }
<input type="hidden" name="id" value="${entityId}" />
<input type="hidden" name="sid" value="${sid}" />
<div class="col-md-8">

    <div class="form-group">
        <label for="template">Template Name</label>
        <input type="text" class="form-control" name="entity.reformat_template_name" id="reformat_template_name" value="${entity ? entity.reformat_template_name : ''}"/>
    </div>
    <div class="form-group">
        <label for="description">Description</label>
        <input type="text" class="form-control" name="entity.description" id="description" value="${entity ? entity.description : ''}"/>
    </div>
    <div class="form-row">
        <div class="form-group col">
            <label for="datagram_type">Datagram Type</label>
            <input type="text" class="form-control" name="entity.datagram_type" id="datagram_type" value="${entity ? entity.datagram_type : ''}"/>
        </div>
        <div class="form-group col">
            <label for="business_type">Business Type</label>
            <input type="text" class="form-control" name="entity.business_type" id="business_type" value="${entity ? entity.business_type : ''}"/>
        </div>
    </div>
    <div class="form-group">
        <label for="template">Template</label>
        <textarea class="form-control" id="template" name="entity.template" rows=18 >${entity ? entity.template : ''}</textarea>
    </div>
    <div class="form-group">
        <label for="split_template_name" class="text-capitalize">split template</label>
        <input type="text" class="form-control" name="split_template_name" id="split_template_name" readonly value="${splitTemplate ? splitTemplate.split_template_name : ''}"/>
    </div>
<p>
    <button type="submit" class="btn btn-primary" name="save" id="template">Save</button>
    #{if sid}
        <a href="@{controllers.SplitTemplate.edit(sid)}" role="button" class="btn btn-secondary"> Back to split template</a>
    #{/if}
</p>
</div>
#{/form}